package cn.ffcs.bpm.web;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.apache.struts2.ServletActionContext;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

import com.opensymphony.xwork2.ActionContext;

import cn.ffcs.base.web.BaseAction;
import cn.ffcs.base.web.PageControl;
import cn.ffcs.bpm.model.ProcessStep;
import cn.ffcs.common.model.Attach;
import cn.ffcs.common.service.AttachService;
import cn.ffcs.share.service.ShareReferenceService;
import cn.ffcs.system.dict.model.Dict;
import cn.ffcs.system.dict.model.DictType;
import cn.ffcs.system.dict.service.DictService;
import cn.ffcs.system.dict.service.DictTypeService;

/**
 * action层，实现页面业务逻辑<br/>
 * <table>
 * <tr>
 * <td>负责人/principal:</td>
 * <td colspan="2">pany</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:</td>
 * <td>修改人:</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author pany
 * @version $Id$
 */
public class ProcessStepAction<P extends ProcessStep> extends BaseAction<P>
{
    private static final int BUFFER_SIZE = 512 * 1024;
    /** 业务POJO **/
    private P processStep;

    /**
     * 新增或修改产品产品字典数据
     * @return
     */
    public String saveOrUpdate()
    {
        baseService.saveOrUpdate(processStep);
        // lProductDictType=dictTypeService.findAll();
        returnMsg = "保存操作已成功！";
        return SUCCESS;
    }

    /**
     * 根据关键字获取实体数据
     * @return
     */
    public String findById()
    {
        if (processStep != null && processStep.getId() != 0)
        {
            processStep = (P) baseService.findById(processStep.getId());
        }
        return SUCCESS;
    }

    /**
     * 删除操作
     * @return
     */
    public String remove()
    {
        baseService.remove(processStep);
        return SUCCESS;
    }

    public P getProcessStep()
    {
        return processStep;
    }

    public void setProcessStep(P processStep)
    {
        this.processStep = processStep;
    }

}
